const fs = require('fs');

// fs.readFile('./lession2-3.html',function (err,data) {
//     if (err) {
//         throw err;
//     }

//     console.log(data.toString());
// })


const p = new Promise(function (resolve,reject) {
    fs.readFile('./lession2-3.htmlk', function(err,data) {
        if (err) reject(err);
        resolve(data);
    })
})

p.then(function (res) {
    console.log(res.toString(), '<---res');
},function (reason) {
    console.log(reason, '<---reason');
})
